<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->notNull()->default('')->comment('商品名');
            $table->integer('category_id')->notNull()->default(0)->comment('分类id');
            $table->string('cover')->notNull()->default('')->comment('封面图');
            $table->string('title')->notNull()->default('')->comment('商品标题');
            $table->string('desc')->notNull()->default('')->comment('简介');
            $table->text('detail')->comment('商品详情');
            $table->integer('admin_id')->notNull()->default(0)->comment('操作管理员');

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
